﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.Master" CodeBehind="Cliente.aspx.cs"
    Inherits="ordserv.Cliente" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <table>
        <tr>
            <td>
                Nome
            </td>
            <td style="width: 300px">
                <asp:TextBox ID="TextBox1" runat="server" Width="298px"></asp:TextBox>
            </td>
            <td>
                <asp:Button ID="Button1" runat="server" Text="Buscar" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Button ID="Button2" runat="server" Text="Novo Cliente" Height="20px" 
                    Width="100px" />
            </td>
        </tr>
    </table>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
        AutoGenerateColumns="False" CellPadding="4" DataKeyNames="IdCliente" DataSourceID="odsCliente"
        Font-Names="Verdana" Font-Size="Smaller" ForeColor="#333333" 
        GridLines="None" SkinID="sknGrdBusca">
        <RowStyle BackColor="#EFF3FB" />
        <Columns>
            <asp:BoundField DataField="IdCliente" HeaderText="IdCliente" 
                InsertVisible="False" ReadOnly="True" SortExpression="IdCliente" />
            <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome">
                <ItemStyle Width="150px" />
            </asp:BoundField>
            <asp:BoundField DataField="CPF" HeaderText="CPF" SortExpression="CPF" />
            <asp:BoundField DataField="DataNascimento" HeaderText="DataNascimento" SortExpression="DataNascimento"
                DataFormatString="{0:d}" />
            <asp:BoundField DataField="Endereco" HeaderText="Endereco" SortExpression="Endereco" />
            <asp:BoundField DataField="Bairro" HeaderText="Bairro" SortExpression="Bairro" />
            <asp:BoundField DataField="CEP" HeaderText="CEP" SortExpression="CEP" />
            <asp:BoundField DataField="IdCidade" HeaderText="IdCidade" SortExpression="IdCidade" />
            <asp:BoundField DataField="Telefone" HeaderText="Telefone" SortExpression="Telefone" />
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:BoundField DataField="Tipo" HeaderText="Tipo" SortExpression="Tipo" />
            <asp:TemplateField HeaderText="Editar">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("IdCliente", "ClienteEdit.aspx?Id={0}") %>'>Editar</asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Excluir">
                <ItemTemplate>
                    <asp:ImageButton ID="ImageButton1" runat="server" CommandName="Delete" 
                        Height="20px" ImageUrl="~/img/delete24.bmp" Width="20px" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#2461BF" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
    <asp:ObjectDataSource ID="odsCliente" runat="server" SelectMethod="SelectByNome"
        TypeName="ordserv.Bussiness.ClienteBS" onselecting="odsCliente_Selecting">
        <SelectParameters>
            <asp:ControlParameter ControlID="TextBox1" ConvertEmptyStringToNull="False" Name="Nome"
                PropertyName="Text" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
